/* 重置reseet */
html,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,button,textarea,menu{margin:0;padding:0;}
header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block;}
table{border-collapse:collapse;border-spacing:0;}
caption,th{text-align:left;font-weight:normal;}
html,body,fieldset,img,iframe,abbr{border:0;}
html{font-family: sans-serif;}
i,cite,em,var,address,dfn{font-style:normal;}
[hidefocus],summary{outline:0;}
li{list-style:none;}
h1,h2,h3,h4,h5,h6,small{font-size:100%;}
sup,sub{font-size:83%;}
pre,code,kbd,samp{font-family:inherit;}
q:before,q:after{content:none;}
textarea{overflow:auto;resize:none;}
label,summary{cursor:default;}
a,button{cursor:pointer;}
h1,h2,h3,h4,h5,h6,em,strong,b{font-weight:bold;}
del,ins,u,s,a,a:hover{text-decoration:none;}
body,textarea,input,button,select,keygen,legend{font:14px/1.14 arial,\5b8b\4f53;color:#333;outline:0;}
body{background:#fff;}
a,a:hover{color:#333;}

/* 公共样式 */
.container{width:1200px;margin: 0 auto; }
.clearfloat::after{content: '';display: block; clear: both;}

//测试用容器,美化界面
.wrap{display: flex; justify-content: space-around; align-items: center; padding: 10px; width: 50%; height: 150px;   border: 1px dotted #b3b4b8; flex-wrap: wrap;}


/*====================三角符号 2020/12/22=========================*/
$y-triangle-w:5px; //三角宽
$y-triangle-o:8px; //三角符号距文本间距
$y-triangle-color:#3d3d3d; //三角颜色

.y-triangle{
    content: "";
    position: relative;
    left: $y-triangle-o;
    top:0;
    vertical-align: middle;
    display: inline-block;
    z-index: 1000;
}
// 箭头向下
.y-triangle-down::after{
    @extend .y-triangle;
    border-top: $y-triangle-w solid $y-triangle-color;
    border-right: $y-triangle-w solid transparent;
    border-left: $y-triangle-w solid transparent;
}
// 箭头向右
.y-triangle-right::after{
    @extend .y-triangle;
    border-top: $y-triangle-w solid transparent;
    border-bottom: $y-triangle-w solid transparent;
    border-left: $y-triangle-w solid $y-triangle-color;
}
// 箭头向左
.y-triangle-left::before{
    @extend .y-triangle;
    left: -$y-triangle-o;
    border-top: $y-triangle-w solid transparent;
    border-bottom: $y-triangle-w solid transparent;
    border-right: $y-triangle-w solid $y-triangle-color;
}

/* ================ 按钮 2020/12/19 ======================= */
$y-btn-w:100px; //按钮组件宽
$y-btn-h:40px; //按钮高
$y-btn-line-h:$y-btn-h; //按钮行高
// 按钮
.y-button{
    display: inline-block;
    width: $y-btn-w;
    height: $y-btn-h;
    line-height: $y-btn-line-h;
    text-align: center;
    border-radius: 5px;
}

/**
 y-mixin-btn混合器定义:
    $borderColor: 边框颜色
    $bgColor: 背景颜色
    $textColor: 文本颜色
    $borderHoverColor： 选中后边框颜色
    $bgHoverColor: 选中后背景颜色
    $textHoverColor: 选中后文本颜色
*/
@mixin y-mixin-btn($borderColor,$bgColor,$textColor,$borderHoverColor,$bgHoverColor,$textHoverColor) {
    @extend .y-button;
    border: 1px solid $borderColor;
    background-color: $bgColor;
    color: $textColor;
    &:hover{
        border: 1px solid $borderHoverColor;
        background-color:$bgHoverColor;
        color: $textHoverColor;
    }
}

// 默认按钮
.y-btn-default{
    @extend .y-button;
    @include y-mixin-btn(#DCDFE6,#FFFFFF, #606266,#C6E2FF,#ECF5FF,#409EFF);
}
//主要按钮
.y-btn-primary{
    @extend .y-button;
    @include y-mixin-btn(#409EFF,#409EFF, white,#66B1FF,#66B1FF,#FFF2FF);
}

//成功按钮
.y-btn-success{
    @extend .y-button;
    @include y-mixin-btn(#67C23A,#67C23A, white,#85CE61,#85CE61,#FFF2FF);
}
//危险按钮
.y-btn-danger{
    @extend .y-button;
    @include y-mixin-btn(#F56C6C,#F56C6C, white,#F78989,#F78989,#FFF2FF);
}

/* ================ 下拉菜单 2020/12/19 ======================= */
$y-dropdown-w:100px; //下拉菜单宽度
$y-dropdown-h:36px; //下拉菜单按钮高度
$y-dropdown-line-h:30px; //下拉菜单项行高
$y-dropdown-btn-border-color:#9e9a9a;//下拉菜单边框颜色
$y-dropdown-btn-color:#0e0d0d;//按钮文本颜色
$y-dropdown-btn-bg-color:#9a9e9e;//按钮背景颜色
$y-dropdown-li-hover-color:#f1f0f0;//选中背景颜色

.y-dropdown{
    position: relative; 
    width: $y-dropdown-w;
    button {
        position: absolute;
        left: 0;
        top: 0;
        width: $y-dropdown-w + 2;
        height: $y-dropdown-h;
        border: 1px solid $y-dropdown-btn-border-color;
        outline: none; 
        background-color: $y-dropdown-btn-bg-color;
        color: $y-dropdown-btn-color;
        cursor: pointer;
        // 移入移出隐藏显示
        // &:hover+ul{
        //     visibility: visible;
        // }
    }
    ul {
        position: absolute;
        left: 0;
        top: $y-dropdown-h - 1;
        width: 100%;
        background-color: white;
        border: 1px solid $y-dropdown-btn-border-color;
        line-height: $y-dropdown-line-h;
        display: none; 
       
        li{
            text-align: center;
            &:hover{
                background-color: $y-dropdown-li-hover-color; 
                cursor: pointer;
            }
            &:not(:last-child){ 
                border-bottom: 1px solid $y-dropdown-btn-border-color;
            }
        }
    }
}

/* ================ 计数器 2020/12/19 ======================= */
$y-inputnumber-w:180px; //计数器宽
$y-inputnumber-btn-w:42px; //计数按钮宽
$y-inputnumber-h:40px; //计数器高
$y-inputnumber-border-color:#DCDFE6; //边框颜色
$y-inputnumber-border-hover-color:#c1c2c5; //边框选中颜色

@mixin y-inputnumber-btn {
    width: $y-inputnumber-btn-w;
    border: none;
    font-size: 18px;
    color: #939598;
    background-color: #F5F7FA;
    cursor: pointer;
}
.y-inputnumber{
    width: $y-inputnumber-w;
    height: $y-inputnumber-h;
    display: flex;
    border: 1px solid $y-inputnumber-border-color;
    border-radius: 5px;
    overflow: hidden;
    &:hover{
        border: 1px solid $y-inputnumber-border-hover-color;
    }
    input:first-of-type{
       @include y-inputnumber-btn();
    }
    input:nth-child(2){
        width: $y-inputnumber-w - $y-inputnumber-btn-w*2;
        border-left: 1px solid $y-inputnumber-border-color;
        border-right: 1px solid $y-inputnumber-border-color;
        border-top: none;
        border-bottom: none;
        text-align: center;
        cursor: pointer;
    }
    input:last-of-type(){
        @include y-inputnumber-btn();
    }
}

/* ================ 上传 2020/12/19 ======================= */
$y-upload-w:128px; //上传组件宽
$y-upload-h:$y-upload-w; //上传组件高
$y-upload-border-color:#666666; // 上传组件边框颜色
$y-upload-border-hover-color:#0b89f0; // 上传组件边框颜色

.y-upload{
    position: relative;
    width: $y-upload-w;
    height: $y-upload-h;
    border: 1px dotted $y-upload-border-color;
    &:hover{
        border: 1px dotted $y-upload-border-hover-color;
    }
    input{
        opacity: 0;
    }

    label{
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%,-50%);
        font-size: 38px;
        color: $y-upload-border-color;
        cursor: pointer;
    }
    img{
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        overflow: hidden;
    }
    
}


/* ================ 弹框-模态框 2020/12/21 ======================= */
$message-box-w:600px;//弹框宽
$message-box-min-h:100px; //弹框最小高

.y-modal{
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    display: none; //默认隐藏
    //遮罩层
    .modal-dialog{
        position: relative;
        left: 0px;    
        top: 0px;
        width:100%;
        height:100%;
        z-index: 1000;
        background-color: rgba(0, 0, 0,.5);  /* 背景半透明 */
       
        //弹出框
        .modal-content{
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%,-50%);
            width: $message-box-w;
            background-color: #fff;
            border:1px solid #424141;
            box-shadow: 10px 10px 5px #424141;
            border-radius: 8px;
            padding: 15px;
            display: flex;
            flex-direction: column;
            .modal-header{
                padding: 10px 0;
                margin-bottom: 5px;
                border-bottom: 1px solid #cccccc;
                font-size: 18px;
                font-weight: bold;
            }
            .modal-body{
                padding: 10px 0;
                flex: 1;
                min-height: $message-box-min-h;
            }
            .modal-footer{
                display: flex;
                flex-basis: 50px;
                justify-content: flex-end;
                align-items: flex-end;
                border-top: 1px solid #cccccc;
                //按钮默认间距5px
                button,a{
                    margin-left: 5px;
                }
            }
        }
    }
}

/* ================ 轮播carousel 2020/12/22 ======================= */
.y-slider-wrap {
    position: relative;
    width: 600px;
    margin: 100px auto;
    overflow: hidden;
    //  轮播项
    .slider {
        width: 500%;
        position: relative;
        left: 0;
        li {
            float: left;
            a{
                display: inline-block;
                width: 100%;
                height: 100%;
                position: relative;
            }
            img {
                width: 600px;
            }
            p{
                position: absolute;
                left: 50%;
                transform: translate(-50%,-50%);
                font-size: 28px;
                color: white;
                width: 50%;
                &:nth-child(1){
                    /* animation: animateSliderUp .5s ease-in; */
                    /* left: 40%; */
                    top: 40%;
                    opacity: 0;
                }
                &:nth-child(2){
                    /* animation: animateSliderDown .5s ease-in; */
                    /* left: 60%; */
                    top: 60%;
                    opacity: 0;
                }
            }
        }
    }
    // 显示快速按钮
    &:hover{
        .slider-btn{
            display: block;
        }
    }
    // 快速按钮
    .slider-btn{
        display: none;
        a {
            display: inline-block;
            width: 30px;
            height: 50px;
            line-height: 50px;
            text-align: center;
            font-size: 24px;
            background-color: rgba(17, 17, 17, 0.2);
            color: white;
            &:nth-child(1){
                position: absolute;
                top: 50%;
                left: 0;
                transform: translateY(-50%);
            }
            &:nth-child(2){
                position: absolute;
                top: 50%;
                right: 0;
                transform: translateY(-50%);
            }
        }
    }
    // 指示器
    .cursor-pointer{
        position: absolute;
        bottom: 20px;
        left: 50%;
        transform: translateX(-50%);
        li{
            display: inline-block;
            a{
                display: inline-block;
                width: 15px;
                height: 15px;
                line-height: 15px;
                text-align: center;
                border-radius: 50%;
                background-color: #1f1e1e;
                color: #cccccc;
                margin-left: 10px;
            }
        }
       
    }
    .active{
        background-color: #f5f4f1 !important
    }
    
}

/* ================ Divider 分割线 2020/12/22 ======================= */
$divider-color:#666666; //文本颜色
$divider-hr-color:#cccccc; //分割线颜色
//水平分割线
.y-divider{
    position: relative;
    top: 0;
    left: 0;
    display: block;
    width: 100%;
    text-align: center;
    color: $divider-color;
    div{
        position: absolute;
        top: 50%;
        left: 0;
        width: 100%;
        border-top: 1px solid $divider-hr-color;
    }
    span{
        position: relative;
        top: 0;
        left: 0;
        padding: 0 8px;
        background-color: #ffffff;
    }
}
// 垂直分割线
$y-divider-vertical-h:15px; //高度
$y-divider-vertical-margin:15px; //左右间距
$y-divider-vertical-color:#cccccc; //分割线颜色
.y-divider-vertical::after{
    content: '';
    display: inline-block;
    width: 1px;
    height: $y-divider-vertical-h;
    background-color: $y-divider-vertical-color;
    margin: 0 $y-divider-vertical-margin;
    vertical-align: middle;
}

/*======================== steps 步骤条 时间线 2020/12/23 ==============================*/
// 思路: 左边水平线右节点看作一个完整节点, 第一个节点没有水平线
/**
$n:节点总个数
$ul-h: 容器高
$span-w：节点宽
$color: 文本颜色
$bgcolor: 文本背景颜色
$hoverColor:选中文本颜色
$hoverbgcolor:选中背景颜色
*/
@mixin y-steps-mixin($n,$ul-h,$span-w,$color,$bgcolor,$hoverColor,$hoverbgcolor) {
    $y-steps-li-line-h:4px; //默认水平线高
    // 组件容器
    ul{
        position: relative;
        height: $ul-h;
        margin-left: $span-w;
        font-size: 0;
        color: $color;
        // 整条水平线 居中灰色
        &::after {
            content: "";
            position: absolute;
            left: 0;
            top: 50%;
            transform: translateY(-50%);
            height:$y-steps-li-line-h;
            width: 100%;
            background-color: $bgcolor;
            z-index: 1;
        }
        li {
            position: relative;
            display: inline-block;
            width: 1 / ($n - 1) * 100%; // 节点百分比
            height: $span-w;
            font-size: 14px;
            z-index: 5;
            &:first-child {
                width: $span-w;
                margin-left: -$span-w;
            }
            // 圆形节点
            span{
                content: "";
                position: absolute;
                top: 0;
                right: 0;
                width: $span-w;
                height: $span-w;
                line-height: $span-w;
                text-align: center;
                border-radius: 50%;
                background-color: $bgcolor;
                z-index: 7;
            }
        }
        // 选中状态
        .y-active{
            span{
                color: $hoverColor;
                background-color: $hoverbgcolor;
            }
            &::after {
                content: "";
                position: absolute;
                left: 0;
                top: 50%;
                transform: translateY(-50%);
                height: $y-steps-li-line-h;
                width: 100%;
                background-color: $hoverbgcolor;
                z-index: 6;
            }
        }
    }
}

.y-steps{
    @include y-steps-mixin(5,40px,40px,#ffffff,#d9d9d9,#ffffff,#11c2c2);
}
.y-steps-h{
    @include y-steps-mixin(6,60px,60px,#ffffff,#979494,#eff1ea,#0d9bee);
}

/*======================== 时间线 TimeLine ============================*/
/* 
    $y-timeline-li-h: 节点高
    $y-timeline-span-w: 节点宽
    $y-timeline-w: 时间线宽
    $y-timeline-margin-l: 节点与文本间距
    $y-timeline-bgcolor: 时间线颜色
    $y-timeline-li-bgcolor:节点背景颜色
    $y-timeline-n:  节点总个数 
*/
@mixin y-timeline-mixin($y-timeline-n,$y-timeline-li-h,$y-timeline-span-w,$y-timeline-w,$y-timeline-margin-l,$y-timeline-bgcolor,$y-timeline-li-bgcolor) {
    $y-timeline-ul-min-w:200px; //ul最小宽度默认值
    ul{
        margin-left: $y-timeline-margin-l + $y-timeline-span-w*2;
        position: relative;
        top: 0;
        left: 0;
        min-width: $y-timeline-ul-min-w;
        margin-top: $y-timeline-span-w;
        // 时间线
        &::before{
            content: '';
            position:absolute;
            left: -$y-timeline-span-w - $y-timeline-margin-l;
            width: $y-timeline-w;
            height: $y-timeline-li-h * ($y-timeline-n - 1);
            background-color: $y-timeline-bgcolor;
        }
        
        li{
            @for $i from 0 through $y-timeline-n {
                &:nth-child(#{$i + 1}){
                    position: absolute;
                    top: $y-timeline-li-h * $i;
                    margin-top:-$y-timeline-span-w;
                    &::before{
                        content: '';
                        position: absolute;
                        left: -$y-timeline-span-w * 2 - $y-timeline-margin-l + $y-timeline-w/2;
                        transform: translateX(50%);
                        width: $y-timeline-span-w;
                        height: $y-timeline-span-w;
                        @if $i%2 == 0 {
                            background-color: $y-timeline-li-bgcolor;
                        }@else{
                            background-color: rgb(178, 216, 11);
                        }
                      
                        border-radius: 50%;
                    }
                }
            }
            // 内容部分样式
            div{
                h2{
                    margin-bottom: 10px;
                }
            }
        }
    }
}

.y-timeline{
    $y-timeline-n:5; // 节点总个数
    $y-timeline-li-h:100px; //节点高
    $y-timeline-span-w:20px; //节点宽
    $y-timeline-w:4px; //时间线宽
    $y-timeline-margin-l:10px; //节点与文本间距
    $y-timeline-bgcolor:#cccccc; //时间线颜色
    $y-timeline-li-bgcolor:#11c2c2; //节点背景颜色

    height: $y-timeline-n * $y-timeline-li-h; //时间线容器高度
    @include y-timeline-mixin($y-timeline-n, $y-timeline-li-h, $y-timeline-span-w, $y-timeline-w, $y-timeline-margin-l, $y-timeline-bgcolor,$y-timeline-li-bgcolor)
}

.y-timeline-2{
    $y-timeline-n:3; // 节点总个数
    $y-timeline-li-h:60px; //节点高
    $y-timeline-span-w:10px; //节点宽
    $y-timeline-w:2px; //时间线宽
    $y-timeline-margin-l:5px; //节点与文本间距
    $y-timeline-bgcolor:#cccccc; //时间线颜色
    $y-timeline-li-bgcolor:#1a0575; //节点背景颜色

    height: $y-timeline-n * $y-timeline-li-h; //时间线容器高度
    
    @include y-timeline-mixin($y-timeline-n, $y-timeline-li-h, $y-timeline-span-w, $y-timeline-w, $y-timeline-margin-l, $y-timeline-bgcolor,$y-timeline-li-bgcolor)
}

/*======================== Tabs 标签页 2020-12-24 ============================*/
/**
    $y-tabs-color: 文本颜色
    $y-tabs-select-color: 选中颜色
    $y-tabs-bgcolor: 选项标签背景颜色，默认透明
    $y-tabs-border-color: 边框颜色
*/
@mixin y-tabs-minxi($y-tabs-color,$y-tabs-select-color, $y-tabs-bgcolor,$y-tabs-border-color) {
    position: relative;
    // tab标签项
    ul{
        display: flex;
        margin:20px 0; // tabs上下外边距
        li{
            width: 100px;
            height: 40px;
            line-height: 40px;
            text-align: center;
            border: 1px solid $y-tabs-border-color;
            border-right: none;
            color: $y-tabs-color;
            cursor: pointer;
            &:first-of-type{
                border-radius: 8px 0 0 0;
                border-right: none;
            }
            &:last-of-type{
                border-right: 1px solid $y-tabs-border-color;
                border-radius: 0 8px 0 0;
            }
        }
        // 底线效果
        &::after{
            content: '';
            height: 41px;
            width: 60%;
            border-bottom: 1px solid $y-tabs-border-color;
        }
        // 选中文本颜色
        .y-active{
            color: $y-tabs-select-color;
            border-bottom: none;
            background-color: $y-tabs-bgcolor;
        }
    }
    // 容器布局
    ol{
        overflow: hidden;
        >li{
            display: none;
        }
        .y-on{
            display: block;
        }
    }
}
.y-tabs{
    $y-tabs-color:#303133; //文本颜色
    $y-tabs-select-color:#0b89f0; //选中颜色
    $y-tabs-bgcolor: transparent; //选项标签背景颜色，默认透明
    $y-tabs-border-color: #cccccc; //边框颜色
    @include y-tabs-minxi($y-tabs-color,$y-tabs-select-color,$y-tabs-bgcolor,$y-tabs-border-color);
}
.y-tabs-2{
    $y-tabs-color:#303133; //文本颜色
    $y-tabs-select-color:#f2f5f7; //选中颜色
    $y-tabs-bgcolor: #13a34f; //选项标签背景颜色，默认透明
    $y-tabs-border-color: #cccccc; //边框颜色
    @include y-tabs-minxi($y-tabs-color,$y-tabs-select-color,$y-tabs-bgcolor,$y-tabs-border-color);
}

/*======================== Select 选择器 2020-12-24  ============================*/
.y-select {
    position: relative;
    display: inline-block;
    text-align: left;
    vertical-align: middle;
    line-height: 10px;
    dt {
        display: inline-block;
        line-height: 24px;
        height: 24px;
        text-align: left;
        padding: 3px 18px 3px 10px;
        border: 1px #c3c7c8 solid;
        overflow: hidden;
        cursor: pointer;
    }
    dd {
        position: absolute;
        top: 100%;
        left: 0;
        margin: 1px 0 0;
        padding: 4px 0;
        line-height: 18px;
        max-height: 192px; //只能显示8行
        background: #fff;
        border: 1px solid #a6a6a6;
        -ms-box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
        box-shadow: 0 5px 10px rgba(0, 0, 0, 0.2);
        zoom: 1;
        overflow: hidden;
        display: none; //隐藏列表项

        li {
            cursor: pointer;
            display: inline;
            a {
                display: block;
                padding: 3px 15px;
                white-space: nowrap;
                font-size: 12px;
                &:hover {
                    background-color: #08c;
                    color: #FFF;
                }
            }
        }
        
    }
    // 显示列表项
    .open-select{
        display: block;
    }
}
/*======================== Table 表格 2020-12-25  ============================*/
@mixin y-table-mixin($borderColor,$thBgColor,$thColor,$tdColor,$aColor,$trHoverColor) {
    &,tr,th,td{
        border: 1px solid $borderColor;
        border-collapse: collapse;
    }
    tr {
        line-height: 40px;
        th {
            width: 200px;
            text-align: center;
            background-color: $thBgColor;
            color: $thColor;
            font-weight: bold;
        }

        td {
            text-align: center;
            color: $tdColor;
            a{
                color: $aColor;
                &:hover{
                    text-decoration: underline;
                }
            }
        }
        &:hover {
            background-color: $trHoverColor;
        }

    }
 
}
.y-table{
    @include y-table-mixin( #EBEEF5,#FFFFFF,#909399,#909399,#409EFF,#F5F7FA)
}
.y-table-1{
    @include y-table-mixin( #babcbe,#7e991e,#eff1f5,#909399,#409EFF,#F5F7FA)
}
